<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>axios练习</title>
	</head>
	<body>
		<script src="../js/axios.js"></script>
		<script>
			/* 注意事项:
			 1.axios将原来的嵌套结构,改为链式加载方式
			 2.我们通过axios得到的,回调函数中的data,补充服务器的返回值,
			 而是promise对象*/
			axios.get("http://localhost:8090/axios/getUser").then(function(result){
				console.log(result.data)
				console.log(result)
			})
			
			axios.get("http://localhost:8090/axios/getUserById?id=100").then(function(result){
				console.log(result.data)
				console.log(result)
			})
			let name="tomcat"
			let age=100
			axios.get(`http://localhost:8090/axios/User/${name}/${age}`).then(function(result){
				console.log(result.data)
				console.log(result)
			})	
		
			
		</script>
	</body>
</html>
